﻿/* Copyright 2008-10 Jarrett Vance
* see http://www.codeplex.com/blogsvc/license */
$().ready(function() {

  $('.settings.categories a.remove').live("click", function() {
    var $this = $(this);
    $.post($this.attr('href'), {}, function(data) {
      if (data.success) $this.closest('li').fadeOut(function() { $(this).remove(); }); else alert(data.error);
    }, 'json');
    return false;
  });

  wireSchemeChange();
});

function wireSchemeChange() {
  $('.settings.categories select').change(function() {
    $.get($(this).val(), function(data) { $('.settings.categories').replaceWith(data); wireSchemeChange(); });
  });
}